package com.controller.library;

import java.io.IOException;
import java.io.UnsupportedEncodingException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class TLogoutServlet extends HttpServlet{

	/**
	 * 
	 */
	private static final long serialVersionUID = 8129442816385755118L;
	public void service(HttpServletRequest request,HttpServletResponse response){
		try {
			request.setCharacterEncoding("utf-8");
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		if(request.getSession().getAttribute("teacher")!=null){
			request.getSession().removeAttribute("teacher");
		}
		try {
			response.sendRedirect("/Exam1/teacher/t_page/index.htm");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
